﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;


namespace Sublimation
{
    public class EnemyUnitBigBoss : EnemyUnit
    {
        new protected int NUMBER_OF_FRAMES_TO_PLAY = 4;
        new protected const int FRAMES_PER_SECOND = 10;



        protected Texture2D halo;
        public EnemyUnitBigBoss(WorldProperties worldProperties, EnemyKind kind)
            : base(worldProperties, kind)
        {
            Origin = new Vector2(26, 38);
            spriteColor.G -= 120;
            spriteColor.B -= 120;
            spriteColor.R -= 50;
        }

        protected override void LoadContent()
        {
            base.LoadContent();

            textureAnimator = new AnimatedSprite.AnimatedTexture(Origin = new Vector2(26, 38), Rotation, Scale, 1.0f);
            textureAnimator.Load(Game.Content, "Sprites\\enemy3", NUMBER_OF_FRAMES_TO_PLAY, FRAMES_PER_SECOND);
            textureAttack = new AnimatedSprite.AnimatedTexture(new Vector2(36, 46), Rotation, Scale * 0.9f, 0.8f);
            textureAttack.Load(Game.Content, "Sprites\\enemy3_attack", 8, FRAMES_PER_SECOND);
            halo = Game.Content.Load<Texture2D>("Sprites\\nest_center");

            Scale = 2f;
        }

        public override void Kill()
        {
            base.Kill();

            if (Life <= 0) new Animation(worldProperties, this, Scale, 4, 10, "Sprites\\enemy3_dying");
            worldProperties.EnemyCount++;
        }

        public override void ApplyDamage(float damage)
        {

            worldProperties.HighScore.CurrentScore += (int)damage;
            worldProperties.DrawTextEnemyDamaged(damage, Position);

        }

        public override void Draw(GameTime gameTime)
        {

            spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
            //spriteColor.A = (byte)100;
            spriteBatch.Draw(halo, Position, null, SpriteColor, Rotation, new Vector2(126, 107), Scale * 0.5f, SpriteEffects.None, 1);
            spriteBatch.End();
            base.Draw(gameTime);
        }
    }
}
